-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[air] pyarrow.fs
persistence (7/n): ray.train.Checkpoint
restore: Auto-recovery fault tolerance
#38141
Merged
ericl
merged 114 commits into
ray-project:master
from
justinvyu:air/persistence/restore_new_checkpoint_autoft
Aug 8, 2023
Merged
[air] pyarrow.fs
persistence (7/n): ray.train.Checkpoint
restore: Auto-recovery fault tolerance
#38141
ericl
merged 114 commits into
ray-project:master
from
justinvyu:air/persistence/restore_new_checkpoint_autoft
Aug 8, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]> Update to use the new checkpoint id attribute Signed-off-by: Justin Yu <[email protected]> Add todo comment to remove legacy path Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
… -> driver Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]> Fix lint Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]> Fix lint Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
…persistence/storage_context_to_worker_temp
Signed-off-by: Justin Yu <[email protected]>
…persistence/new_checkpoint Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]> Fix lint for session.py Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]> Fix lint for storage.py Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
…persistence/restore_new_checkpoint_autoft
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
justinvyu
removed
the
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
label
Aug 7, 2023
@ericl This one is ready for a 2nd round. Then have 2 more lined up to finish restoration for trainers. |
Just a small remaining comment. |
ericl
added
the
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
label
Aug 7, 2023
Signed-off-by: Justin Yu <[email protected]>
…persistence/restore_new_checkpoint_autoft
Signed-off-by: Justin Yu <[email protected]>
ericl
approved these changes
Aug 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Signed-off-by: Justin Yu <[email protected]>
…persistence/restore_new_checkpoint_autoft
Signed-off-by: Justin Yu <[email protected]>
…persistence/restore_new_checkpoint_autoft
justinvyu
added
tests-ok
The tagger certifies test failures are unrelated and assumes personal liability.
and removed
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
labels
Aug 8, 2023
@ericl Good to merge now |
NripeshN
pushed a commit
to NripeshN/ray
that referenced
this pull request
Aug 15, 2023
… Auto-recovery fault tolerance (ray-project#38141) This PR handles the auto-restoration fault tolerance direction for the new `Checkpoint` API: - The latest `_TrainingResult(checkpoint, metrics)` data saved in the trial state on the driver gets sent to the workers for restoration. - No checkpoint data gets downloaded during restoration. - The user can access the checkpoint with `to_directory` and `as_directory`. This PR also fixed a race condition in `as_directory`: the deletion lock should be set *before* the internal call to `to_directory`. Otherwise, worker 1 can exit the context and delete the directory, while worker 2 is still waiting for the download to finish. Then, once worker 1 lets go of the download lock, the directory has already been deleted, so worker 2 errors.. ### Other comments Here were some other ideas for restoring the checkpoint index: 1. Store it inside the `_TrainingResult` when saving the checkpoint. Then, pass this index along with the checkpoint all the way to the worker worker. Use the index to initialize the starting checkpoint number. 2. Save it inside the Trial storage context. The trial storage context saved on the driver never sets the checkpoint_index, because that indexing is handled all the way on the trainable/worker. **This is what we're doing now. The driver's trial.storage.current_checkpoint_index gets incremented on every reported checkpoint, to stay in sync with the worker/trainable.** Signed-off-by: NripeshN <[email protected]>
arvind-chandra
pushed a commit
to lmco/ray
that referenced
this pull request
Aug 31, 2023
… Auto-recovery fault tolerance (ray-project#38141) This PR handles the auto-restoration fault tolerance direction for the new `Checkpoint` API: - The latest `_TrainingResult(checkpoint, metrics)` data saved in the trial state on the driver gets sent to the workers for restoration. - No checkpoint data gets downloaded during restoration. - The user can access the checkpoint with `to_directory` and `as_directory`. This PR also fixed a race condition in `as_directory`: the deletion lock should be set *before* the internal call to `to_directory`. Otherwise, worker 1 can exit the context and delete the directory, while worker 2 is still waiting for the download to finish. Then, once worker 1 lets go of the download lock, the directory has already been deleted, so worker 2 errors.. ### Other comments Here were some other ideas for restoring the checkpoint index: 1. Store it inside the `_TrainingResult` when saving the checkpoint. Then, pass this index along with the checkpoint all the way to the worker worker. Use the index to initialize the starting checkpoint number. 2. Save it inside the Trial storage context. The trial storage context saved on the driver never sets the checkpoint_index, because that indexing is handled all the way on the trainable/worker. **This is what we're doing now. The driver's trial.storage.current_checkpoint_index gets incremented on every reported checkpoint, to stay in sync with the worker/trainable.** Signed-off-by: e428265 <[email protected]>
vymao
pushed a commit
to vymao/ray
that referenced
this pull request
Oct 11, 2023
… Auto-recovery fault tolerance (ray-project#38141) This PR handles the auto-restoration fault tolerance direction for the new `Checkpoint` API: - The latest `_TrainingResult(checkpoint, metrics)` data saved in the trial state on the driver gets sent to the workers for restoration. - No checkpoint data gets downloaded during restoration. - The user can access the checkpoint with `to_directory` and `as_directory`. This PR also fixed a race condition in `as_directory`: the deletion lock should be set *before* the internal call to `to_directory`. Otherwise, worker 1 can exit the context and delete the directory, while worker 2 is still waiting for the download to finish. Then, once worker 1 lets go of the download lock, the directory has already been deleted, so worker 2 errors.. ### Other comments Here were some other ideas for restoring the checkpoint index: 1. Store it inside the `_TrainingResult` when saving the checkpoint. Then, pass this index along with the checkpoint all the way to the worker worker. Use the index to initialize the starting checkpoint number. 2. Save it inside the Trial storage context. The trial storage context saved on the driver never sets the checkpoint_index, because that indexing is handled all the way on the trainable/worker. **This is what we're doing now. The driver's trial.storage.current_checkpoint_index gets incremented on every reported checkpoint, to stay in sync with the worker/trainable.** Signed-off-by: Victor <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
This PR handles the auto-restoration fault tolerance direction for the new
Checkpoint
API:_TrainingResult(checkpoint, metrics)
data saved in the trial state on the driver gets sent to the workers for restoration.to_directory
andas_directory
.This PR also fixed a race condition in
as_directory
: the deletion lock should be set before the internal call toto_directory
. Otherwise, worker 1 can exit the context and delete the directory, while worker 2 is still waiting for the download to finish. Then, once worker 1 lets go of the download lock, the directory has already been deleted, so worker 2 errors..Other comments
Here were some other ideas for restoring the checkpoint index:
_TrainingResult
when saving the checkpoint. Then, pass this index along with the checkpoint all the way to the worker worker. Use the index to initialize the starting checkpoint number.Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.